@page
@namespace EasyAbp.PrivateMessaging.Web.Pages.PrivateMessaging.PrivateMessages.PrivateMessage
@using EasyAbp.PrivateMessaging.Authorization
@using EasyAbp.PrivateMessaging.Localization
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@inject IHtmlLocalizer<PrivateMessagingResource> L
@inject IAuthorizationService Authorization
@inject IPageLayout PageLayout
@model OutboxModel

@section scripts
{
    <abp-script src="/Pages/PrivateMessaging/PrivateMessages/PrivateMessage/outbox.js" />
}
@section styles
{
    <abp-style src="/Pages/PrivateMessaging/PrivateMessages/PrivateMessage/common.css"/>
}
@{
    PageLayout.Content.Title = L["PrivateMessageInbox"].Value;
    PageLayout.Content.BreadCrumb.Add(L["Menu:PrivateMessage"].Value);
}

<abp-card>
    <abp-card-header>
        <abp-row>
            <abp-column size-md="_2">
                <h2>@L["PrivateMessageOutbox"]</h2>
            </abp-column>
            <abp-column size-md="_10" class="text-right">
                <abp-button id="InboxButton"
                            text="@L["PrivateMessageInbox"].Value"
                            button-type="Secondary" />
                @if (await Authorization.IsGrantedAsync(PrivateMessagingPermissions.PrivateMessages.Create))
                {
                    <abp-button id="NewPrivateMessageButton"
                                text="@L["CreatePrivateMessage"].Value"
                                icon="plus"
                                button-type="Primary"/>
                }
            </abp-column>
        </abp-row>
    </abp-card-header>
    <abp-card-body>
        <abp-table striped-rows="true" id="PrivateMessageTable">
            <thead>
            <tr>
                <th>@L["Actions"]</th>
                <th>@L["PrivateMessageToUserName"]</th>
                <th>@L["PrivateMessageTitle"]</th>
                <th>@L["PrivateMessageCreationTime"]</th>
            </tr>
            </thead>
        </abp-table>
    </abp-card-body>
</abp-card>